//
//  MineView.m
//  网络FM
//
//  Created by dengzhicheng on 15/5/25.
//  Copyright (c) 2015年 dengzhicheng.com. All rights reserved.
//

#import "MineView.h"

@implementation MineView

- (void)dealloc
{
    [_leftButton release];
    [_rightButton release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
      //  self.userInteractionEnabled = YES;
        
        self.leftButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width / 6 * 5, self.frame.size.height )];
        [_leftButton setBackgroundColor:[UIColor redColor]];
        [_leftButton addTarget:self action:@selector(buttonClicked:) forControlEvents:(UIControlEventTouchUpInside)];
        [self addSubview:_leftButton];
        
        self.rightButton = [[UIButton alloc] initWithFrame:CGRectMake(self.frame.size.width - 15, (self.frame.size.height - 15) / 2, 15, 15)];
        [_rightButton setBackgroundColor:[UIColor clearColor]];
        [_rightButton setImage:[UIImage imageNamed:@"向右箭头.png"] forState:UIControlStateNormal];
        [self addSubview:_rightButton];
        
    }
    return self;
}
- (void)buttonClicked:(UIButton *)btn
{
    [(NSObject *)self.target performSelector:self.action withObject:self];
    
}


@end
